<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class  CreateMyOrderTable extends Migration
{
    /**
     * Run the migrations.
     * 我的定单
     * @return void
     */
    public function up()
    {
        //
        Schema::create('my_order', function (Blueprint $table) {
            $table->engine='INNODB';
            $table->comment='我的定单';
            $table->increments('id')->unsigned()->comment('自动增长主键');
            $table->integer('uid')->unsigned()->default(0)->index('uid')->comment('所属企业会员uid');
            $table->integer('vip_id')->unsigned()->default(0)->index('vip_id')->comment('套餐类型');
            $table->string('vip_name',100)->comment('套餐名称');
            $table->tinyInteger('stats')->unsigned()->default(0)->comment('定单状态0 未支付，1 取消 2 支付');
            $table->tinyInteger('pay_type')->unsigned()->default(0)->comment('0表示未选择支付方式，类型参数支付表');
            $table->decimal('money',9,2)->unsigned()->default(0.00)->comment('金额');
            $table->string('token',30)->comment('预防生成重复的定单');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
        Schema::drop('my_order');
    }
}
